/**
 * Created by gaoyj on 2018/6/30.
 */
window.onload = function (ev) {
    topbar.hide();
};

$('#dataTable').bootstrapTable({
    url: '/UserController/getUserByIP',
    height: $(window).height() - 200,
    pageSize: 30,
    pageList: [30, 50, 100],
    clickToSelect: true,
    // singleSelect: true,
    queryParams: queryParams,
    queryParamsType: '',
    sidePagination: 'server',
    responseHandler: function (res) {
        return {
            "rows": res   //数据
        };
    },
    columns: [
        {
            width: '30px',
            checkbox: true
        },
        {
            width: '30px',
            align: 'center',
            formatter: function (v, row, index) {
                return index + 1
            }
        }, {
            title: '会员编号 ',
            field: 'account',
            width: '200px',
            align: 'center'
        }, {
            title: '会员名称 ',
            field: 'name',
            width: '200px',
            align: 'center',
            formatter: function (v, o) {
                if (o.supInfo) {
                    return o.supInfo.name;
                }
            }
        }
    ]
})
$("#search").click(function () {
    $("#dataTable").bootstrapTable("refresh");
});

function queryParams(params) {
    return {
        size: params.pageSize,
        page: params.pageNumber,
        ip: $("#ip").val(),
    };
}





